<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/app.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont.css}">
    <title>Blog</title>
</head>
<style>
    .content{
        position: absolute;
        top: 15%;
        left: 20%;
        right: 20%;
        padding: 20px;
        background-color: #fff;
        border-radius: 10px;
    }
    .content-item{
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .content-item input{
        outline:none;
        width: 100%;
        height: auto;
    }
    .content-item span{
        width: 40%;
        padding: 10px 0;
        font-size: 18px;
        font-weight: bold;
        text-align: center;
    } 
</style>
<body>
    <form th:action="@{/user/{uid}/blog(uid=${uid})}" enctype="multipart/form-data" method="post" class="content">
        <div class="content-item">
            <span>标题</span>
            <span><input name="title"></span>
        </div>
        <div class="content-item">
            <span>摘要</span>
            <span><input name="blogAbstract"></span>
        </div>
        <div class="content-item">
            <span>上传文件</span>
            <span><input name="md" type="file" accept="text/markdown"></span>
        </div>
        <div class="content-item">
            <span>上传封面</span>
            <span><input name="img" type="file"></span>
        </div>
        <div class="content-item">
            <span>分类</span>
            <span>
                <select name="cid">
                    <option th:each="category:${categories}" th:text="${category.value}" th:value="${category.id}"></option>
                </select>
            </span>
        </div>
        <div class="content-item">
            <button>提交</button>
        </div>
    </form>
</body>
</html>